<?xml version="1.0"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>Define a Csla Using reference Property</Title>
      <Author>Rockford Lhotka</Author>
      <Description>Define a Csla Using reference property.</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>cslapropur</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>PropertyName</ID>
          <ToolTip>Replace with property name.</ToolTip>
          <Default>Name</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>UsingType</ID>
          <ToolTip>Replace with the referenced type.</ToolTip>
          <Default>UsingTypeName</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>PrivateFieldName</ID>
          <ToolTip>Replace with the referenced object type.</ToolTip>
          <Default>_name</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="vb" Kind="method decl"><![CDATA[Public Shared ReadOnly $PropertyName$Property As PropertyInfo(Of $UsingType$) = RegisterProperty(Of $UsingType$)(Function(c) c.$PropertyName$, RelationshipTypes.PrivateField)
<NotUndoable, NonSerialized> _
Private $PrivateField$Name As $UsingType$ = $PropertyName$Property.DefaultValue
Public ReadOnly Property $PropertyName$() As $UsingType$
  Get
    If $PrivateFieldName$ Is Nothing Then
      $PrivateFieldName$ = $UsingType$.New$UsingType$()
    End If
    Return GetProperty($PropertyName$Property, $PrivateFieldName$)
  End Get
End Property$end$
]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>